public class sign{
  public static void main(String args[]){
    int number,flag,sign;
    number=(int)(Math.random()*10);
    sign=Math.random()<0.5 ? -1 : 1;
    number = sign * number;
    flag = number>0 ? 1 : (number<0 ? -1 : 0);
    System.out.println("number=" + number + " flag=" + flag);
  }
}